srcdir=@srcdir@
top_srcdir=@top_srcdir@

# srcdir must be set before this is included
include @ICU_MAKEFILE@

# the 'locexp' directory lives inside the exported ICU data dir..
lxdatadir= $(datadir)/$(PACKAGE)/$(VERSION)/locexp

## Build directory information
top_builddir = ../..
subdir = locexp/resource

## Extra files to remove for 'make clean'
CLEANFILES = *~ *.res

# DEPS = $(OBJECTS:.o=.d)

# source files which are generated
GENSRC = default.txt index.txt

# resource files
SRC    = en.txt mt.txt el.txt ja.txt

ALLSRC = $(SRC) $(GENSRC)
RES = $(ALLSRC:.txt=.res)

%.res : %.txt
	@echo Rebuilding $@
	@$(sbindir)/genrb $<

## List of phony targets
.PHONY : all all-local install install-local clean clean-local \
distclean distclean-local dist dist-local check check-local res-local

## Clear suffix list
.SUFFIXES :


## List of standard targets
all:  all-local
install:  install-local
clean:  clean-local
distclean :  distclean-local
dist:  dist-local
check:  check-local

all-local: res-local

res-local: $(RES)

mkinstalldirs = $(SHELL) $(sbindir)/mkinstalldirs

default.txt: ../locexp.c
	env PATH=../tools:../../uconv:$(PATH) extractStrings.sh ../locexp.c > ../resource/default.txt || ( rm -f default.txt ; false )

index.txt: Makefile.in $(SRC)
	../tools/genIndex.sh $(SRC) default.txt > index.txt


install-local: install-res

install-res: res-local
	$(mkinstalldirs) $(lxdatadir)
	$(INSTALL) $(ALLSRC) $(RES) $(lxdatadir)

dist-local:

clean-local:
	test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
	rm -f $(GENSRC)

distclean-local: clean-local
	rm -f Makefile 

check-local:

Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
	cd $(top_builddir) \
	 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status

# ICULIBS includes all standard ICU libraries.
# if we wanted only part of the ICU, we could use (for example) just
#         '$(LIBS) -licu-uc -lusort' ...


#ifneq ($(MAKECMDGOALS),distclean)
#-include $(DEPS)
#endif






# icuapps/locexp/resource makefile

# all:	genrb

# index:
# 	@-rm index.txt
# 	make index.txt all

# genrb:
# 	( cd ../../source/tools/genrb ; ICU_DATA=/home/srl/icu/data/ ./genrb /home/srl/icu/data/listrb.d/*.txt )

# index.txt:
# 	genIndex.sh > index.txt
